home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Testing & Debugging / Virtual User / Virtual User Current Release / Examples / External Tool Templates / CPlus Tool Template / RequestDispatcher.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-04  |  3.0 KB  |  122 lines  |  [TEXT/MPS ]

  1. /*
  2.  *    File:        RequestDispatcher.h
  3.  *
  4.  *    Contains:    xxx put contents here xxx
  5.  *
  6.  *    Written by:    Rick Violet
  7.  *
  8.  *    Copyright:    © 1992 by Apple Computer, Inc., all rights reserved.
  9.  *
  10.  *    Change History (most recent first):
  11.  *
  12.  *                11/18/92    RV        xxx put comment here xxx
  13.  *
  14.  *    To Do:
  15.  */
  16.  
  17. #ifndef __RequestDispatcher__
  18. #define __RequestDispatcher__
  19.  
  20. #ifndef        __VUAE__
  21. #include        "VUAE.h"
  22. #endif
  23.  
  24. #ifndef     __Object__
  25. #include         "Object.h"
  26. #endif
  27.  
  28. #ifndef        __List__
  29. #include        "List.h"
  30. #endif
  31.  
  32. #ifndef        __Service__
  33. #include        "Service.h"
  34. #endif
  35.  
  36. #ifndef        __Request__
  37. #include        "Request.h"
  38. #endif
  39.  
  40. #ifndef        __RequestDispatcherResources__
  41. #include        "RequestDispatcher.r.h"
  42. #endif
  43.  
  44. #ifndef        __THREADS__
  45. #include        "Threads.h"
  46. #endif
  47.  
  48. typedef struct VersResRec 
  49. {
  50.     char    major;
  51.     char    minor;
  52.     char    stage;
  53.     char    nonfinal;
  54.     short    countryCode;
  55.     char    versStr[512];
  56. } VersResRec;
  57. //typedef struct VersResRec VersResRec;
  58. typedef VersResRec *VersResRecPtr, **VersResRecHdl;
  59.  
  60. typedef     char* CharPtr;
  61.  
  62. //—————————————————————————————————————————————————————————————————————————————————————
  63. //    RequestDispatcher class -    This class dispatches the incoming
  64. //                                Service Requests the appropriate Service object
  65. //—————————————————————————————————————————————————————————————————————————————————————
  66. class RequestDispatcher : public Object
  67. {
  68.         /*SBR Hacked this in 10/16/94 */
  69. private:    List*                fActiveRequestList;    //———— threaded Requests in process
  70.  
  71. private:    List*                fServices;    
  72. private:    List*                fRequestQueue;
  73.  
  74.         /*SBR Hacked this out, unused! (proper one is Application->fSystem7) 10/16/94 */
  75. //private:    Boolean                fRunningInSystem7;
  76.  
  77. //private:    Request*            fReqBeingProcessed;
  78.     
  79. public:                            RequestDispatcher();
  80. public:        virtual                ~RequestDispatcher(void);
  81.  
  82. public:                void        ConstructAllServiceObjects();
  83.  
  84. /*SBR Hacked this in 05/23/94 */
  85. public:                void        ConstructServicesMenu();
  86.  
  87. public:                void        DoOneRequest();
  88. public:                void        QueueRequest( Request* pReq );
  89.  
  90.     /*SBR Hacked this out 10/16/94 */
  91. //public:                Boolean        CurrentlyProcessingARequest(){ return ( fReqBeingProcessed != nil ); };
  92. //public:                Request*    GetCurrentRequest(){ return fReqBeingProcessed; };
  93. //public:                void        CancelCurrentRequest();
  94.  
  95.     /*SBR Hacked this in 10/16/94 */
  96. public:                Boolean        CancelAllRequests();
  97. public:                void        ProcessRequest( Request* pReq );
  98.  
  99. public:                void        DoCancelReq( Request* pReq );
  100. private:            void        DoGetToolVersReq( Request* pReq );
  101. private:            void        DoGetToolServicesReq( Request* pReq );
  102. private:            void        DoServiceSupportedReq( Request* pReq );
  103. private:            void        DoInitializeReq( Request* pReq );
  104.  
  105.     /*SBR Hacked this in 10/16/94 */
  106. public:                void        DoRequests();
  107. public:                OSErr        CreateNewRequestThread( Request* pReq );
  108. public:                void        RequestIsDone( Request* pReq );
  109.  
  110. public:                void        DispatchCustomRequest( Request* pReq );
  111.  
  112. private:            void        GetToolName( char* pText );
  113. private:            void        GetToolVersionString( char* pText );
  114.  
  115. public:                void        ResetAllTimeOutCounters();
  116. };
  117.  
  118.     /*SBR Hacked this in 10/16/94 as entry point for new Request threads*/
  119. void*        ServiceProcessRequestThread( Request*    pReq );
  120.  
  121. #endif
  122.